package com.settings;

import com.gooddies.utils.Base64Coder;
import com.google.gson.Gson;
import com.universe.WheelList;

/**
 * @author sad
 */
public class Profile {

    private String name;
    private int port;
    private int row;
    private boolean continious = false;
    private WheelList wheels;

    public WheelList getWheels() {
        return wheels;
    }

    public void setWheels(WheelList wheels) {
        this.wheels = wheels;
    }

    @Override
    public String toString() {
        return getName();
    }

    public String formatString() {
        WheelList wheels = getWheels();
        if (wheels == null) {
            wheels = new WheelList();
        }
        String wheelString = new Gson().toJson(wheels);
        String encodedWheels = Base64Coder.encodeString(wheelString);
        return getName() + "→" + getPort() + "→" + getRow() + "→" + isContinious() + "→" + encodedWheels;
    }

    public boolean isContinious() {
        return continious;
    }

    public void setContinious(boolean continious) {
        this.continious = continious;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the port
     */
    public int getPort() {
        return port;
    }

    /**
     * @param port the port to set
     */
    public void setPort(int port) {
        this.port = port;
    }

    /**
     * @return the row
     */
    public int getRow() {
        return row;
    }

    /**
     * @param row the row to set
     */
    public void setRow(int row) {
        this.row = row;
    }

}
